<template>
    <view class="page-community-index">
        <view class="menu">
            <u-row gutter="30">
				<u-col span="6" v-for="(item,index) in menu" :key="index">
                    <u-image :src="item.image" width="100%" height="270rpx" />
				</u-col>
            </u-row>
        </view>
        <view class="p-4" v-if="longList.list.length == 0">
            <u-empty text="暂无内容" mode="list"></u-empty>
        </view> 
        <fly-album ref="refFlyAlbum" :list-data="longList.list"/> 
        <fly-tabbar ref="refFlyTabbar" :current="3"/>
        <fixed-btn ref="refFixedBtn"/>
    </view>
</template>
<script setup lang="ts">
import FlyTabbar from '@/components/FlyTabbar/index.vue'
const refFlyTabbar = ref();
import FlyAlbum from '@/components/FlyAlbum/index.vue'
import FixedBtn from './components/fixedBtn.vue'
import { useLonglist } from '@/static/fn/longList';
const initObj = {
	listApi:'/admin/articles/page',
}
let { searchForm, longList, getList} = useLonglist(initObj);
import {onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { useAppStore } from '@/stores/app';
const appStore = useAppStore();
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
const refFlyAlbum = ref();
const refFixedBtn = ref();
const menu = reactive([
    {name: '建立分会', image: proxy.$icon.establishbranchBtn},
    {name: '历史活动', image: proxy.$icon.historicalactivities},
]);
// let list = ref([]);
onPullDownRefresh(() => {
	getList('refresh');
	setTimeout( () => {
		uni.stopPullDownRefresh();
	}, 1000);
});
onReachBottom(() =>{
	getList();
});
onShow(() => {
    // getList('refresh');
    // setTimeout(() => {
    //     console.log(longList.list);
    // },5000)
    
    longList.list = [
        {
        avatar: '', 
        username: '张三', 
        content: '全面的组件和便捷的工具会让您信手拈来，如鱼得水', 
        imgs: [
            'https://cdn.uviewui.com/uview/album/1.jpg',
        ]
    },
    {
        avatar: '', 
        username: '李四', 
        content: '全面的组件和便捷的工具会让您信手拈来，如鱼得水', 
        imgs: [
            'https://cdn.uviewui.com/uview/album/1.jpg',
            'https://cdn.uviewui.com/uview/album/2.jpg',
            'https://cdn.uviewui.com/uview/album/3.jpg',
            'https://cdn.uviewui.com/uview/album/6.jpg',
            'https://bkimg.cdn.bcebos.com/pic/734f12f3d97165810b46e022?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080'
        ]
    }];
});
</script>
<style lang="scss">
page{background:#fff;}
</style>